﻿using System.Data.Entity;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Rhino.Mocks;

namespace Portal.Repository.Tests.System
{
	[TestClass]
	public abstract class PortalTests
	{
		private DbContextTransaction _transaction;

		protected PortalEntities Entities { get; private set; }

		protected MockRepository Mocks { get; private set; }
		
		[TestCleanup]
		public void TestCleanup()
		{
			_transaction.Rollback();
		}

		[TestInitialize]
		public void TestInitialize()
		{
			Entities = new PortalEntities();
			_transaction = Entities.Database.BeginTransaction();
			Mocks = new MockRepository();
		}
	}
}